package br.ufrj.dcc.dm.util;

import java.util.ArrayList;
import java.util.List;

import br.ufrj.dcc.dm.model.Attribute;
import br.ufrj.dcc.dm.model.Entry;

public abstract class DatasetReader 
{
	public abstract ArrayList<Entry> assembleEntries();
	
	protected Entry createEntry(String line) 
	{
		List<Attribute> attributes = new ArrayList<Attribute>();
		
		int index = 0;
		
		for(String value : line.split(getSeparator()))
		{
			Attribute attribute = new Attribute(value, index);
			attributes.add(attribute);
			
			index ++;
		}
		
		Entry entry = new Entry(attributes);
		
		return entry;
	}
	
	protected abstract String getSeparator();
}
